class FundBasicInfo:
    code = ""
    name = ""
    type = ""
    risk = ""

class FundList:
    fundList = {}  # FundBasicInfo

    def addFundToList(self, fund):
        self.fundList[fund.code] = fund

    def delFundFromList(self, fund):
        if self.fundList.has_key(fund.code):
            self.fundList.pop(fund.code)

    def getFundList(self):
        lst = []

        for code in self.fundList.keys():
            lst.append(self.fundList[code])
        
        return lst

    def addFundToListByFunc(self, func):
        lst = func()
        for fund in lst:
            self.addFundToList(fund)
        return

